import Vue from 'vue'
import Router from 'vue-router'
import index from '@/views/index'
import bigScreen from '@/views/bigScreen/bigScreen'
import tanchuye from '@/views/bigScreen/tanchuye'

import cglmap from '@/views/bigScreen/cglmap'
import orderList from '@/views/bigScreen/orderList'
import onvideo from '@/views/bigScreen/onvideo'
//added by jingzhiqi
import Earth2D from '@/views/bigScreen/cgl0317/ditu-2d'
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'bigScreen',
      component: bigScreen,
       meta: {

         keepAlive: false, // 用来判断是否缓存, 当判断为缓存时, 则路由信息的name和组件的name选项需一致
         index: 1, // 通过比较不同的索引, 来判断是前进动画还是后退动画
        }
    },
    {
      path: '/tanchuye',
      name: 'tanchuye',
      component: tanchuye,
      meta: {

        keepAlive: true, // 用来判断是否缓存, 当判断为缓存时, 则路由信息的name和组件的name选项需一致
        index: 2, // 通过比较不同的索引, 来判断是前进动画还是后退动画
       }
    },
    {
      path: '/world/:type?',
      name: 'Earth2D',
      component: Earth2D
    }

  ]
})
